package com.sjgtw.cloud.web.path.controller;

import com.sjgtw.cloud.common.core.web.controller.BaseController;
import com.sjgtw.cloud.common.core.web.domain.AjaxResult;
import com.sjgtw.cloud.web.path.service.IEmergencyPathService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 应急路径Controller
 *
 * @author lvyoufang
 * @date 2024-03-19
 */
@RestController
@RequestMapping("/emergencyPath")
@Api(tags = "应急路径")
public class EmergencyPathController extends BaseController
{
    @Autowired
    private IEmergencyPathService emergencyPathService;

//    /**
//     * 查询应急路径列表
//     */
//    @ApiOperation(value = "查询应急路径列表")
//    @GetMapping("/list")
//    public TableDataInfo list(EmergencyPath emergencyPath)
//    {
//        startPage();
//        List<EmergencyPath> list = emergencyPathService.selectEmergencyPathList(emergencyPath);
//        return getDataTable(list);
//    }
//
//    /**
//     * 导出应急路径列表
//     */
//    @ApiOperation(value = "导出应急路径列表")
//    @PostMapping("/export")
//    public void export(HttpServletResponse response, EmergencyPath emergencyPath)
//    {
//        List<EmergencyPath> list = emergencyPathService.selectEmergencyPathList(emergencyPath);
//        ExcelUtil<EmergencyPath> util = new ExcelUtil<EmergencyPath>(EmergencyPath.class);
//	    try {
//		    util.exportExcel(response, list, "应急路径数据");
//	    } catch (IOException e) {
//		    e.printStackTrace();
//	    }
//    }

    /**
     * 获取应急路径详细信息
     */
    @ApiOperation(value = "获取应急路径详细信息")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(emergencyPathService.selectEmergencyPathById(id));
    }

//    /**
//     * 新增应急路径
//     */
//    @ApiOperation(value = "新增应急路径")
//    @PostMapping
//    public AjaxResult add(@RequestBody EmergencyPath emergencyPath)
//    {
//        return toAjax(emergencyPathService.insertEmergencyPath(emergencyPath));
//    }
//
//    /**
//     * 修改应急路径
//     */
//    @ApiOperation(value = "修改应急路径")
//    @PutMapping
//    public AjaxResult edit(@RequestBody EmergencyPath emergencyPath)
//    {
//        return toAjax(emergencyPathService.updateEmergencyPath(emergencyPath));
//    }
//
//    /**
//     * 删除应急路径
//     */
//    @ApiOperation(value = "删除应急路径")
//	@DeleteMapping("/{ids}")
//    public AjaxResult remove(@PathVariable String[] ids)
//    {
//        return toAjax(emergencyPathService.deleteEmergencyPathByIds(ids));
//    }
}
